package com.xydtech.ecard.ftp.domain;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.xydtech.common.core.domain.BaseEntity;
import io.swagger.annotations.ApiModelProperty;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

/**
 * @Author: liliya
 * @Description: FTP提供小程序查询条件对象
 * (sheet:价格试算-业务基本信息-定价依据)
 * @Date: Created in 2023/8/15 16:46
 * @Modified:
 */
public class EcardApiFtpInfo extends BaseEntity {

    private static final long serialVersionUID = 1L;

    /**
     * 业务起始日
     * 日期格式必须为：YYYY-MM-DD
     * TODO 这里是否改成String待定,因为转换后会自带00:00:00
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @ApiModelProperty(notes = "业务起始日")
    @NotNull(message = "业务起始日不能为空")
    private Date beginDate;

    /**
     * 业务到期日
     * 日期格式必须为：YYYY-MM-DD
     * TODO 这里是否改成String待定,因为转换后会自带00:00:00
     */
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JsonFormat(pattern = "yyyy-MM-dd",timezone = "GMT+8")
    @ApiModelProperty(notes = "业务到期日")
    @NotNull(message = "业务到期日不能为空")
    private Date endDate;

    /**
     * 业务品种
     * 贷款	    1	ftp_business_variety
     * 定期存款	2	ftp_business_variety
     * 个人活期	3	ftp_business_variety
     * 单位活期	4	ftp_business_variety
     */
    @ApiModelProperty(notes = "业务品种")
    @NotNull(message = "业务品种不能为空")
    private Integer ftpBusinessVariety;

    /**
     * 业务金额     eg:1,000,000.00
     * TODO 应大于0,需要确认小数点长度.
     * 避免小数过长丢失精度,这里暂用字符串接收金额字段值.
     */
    @ApiModelProperty(notes = "业务金额")
    @NotNull(message = "业务金额不能为空")
    private BigDecimal businessAmount;

    /**
     * 对客利率(年利率)    eg: 6.00%
     * TODO 应大于0,需要确认小数点长度.
     * 避免小数过长丢失精度,这里暂用字符串接收金额字段值.
     */
    @ApiModelProperty(notes = "对客利率(年利率)")
    @NotNull(message = "对客利率(年利率)不能为空")
    private BigDecimal customerRate;

    /**
     * 利率类型
     * 固定	1	interest_rate_type
     * 浮动	2	interest_rate_type
     */
    @ApiModelProperty(notes = "利率类型")
    @NotNull(message = "利率类型不能为空")
    private Integer interestRateType;

    /**
     * 重定价频率(月)
     * TODO 固定利率贷款和存款不填此项
     * TODO 固定利率无重定价频率
     * TODO 浮动利率需有重定价频率
     * 3M  	3	repricing_frequency_type
     * 6M  	6	repricing_frequency_type
     * 12M	12	repricing_frequency_type
     */
    @ApiModelProperty(notes = "重定价频率(月)")
    private Integer repricingFrequencyType;

    /**
     * 还款方式
     * TODO 存款不填此项
     * 到期还本付息	    1	loan_repayment_mode_type
     * 到期还本定期结息	2	loan_repayment_mode_type
     * 等额本金	        3	loan_repayment_mode_type
     * 等额本息	        4	loan_repayment_mode_type
     * 按还款计划还款	5	loan_repayment_mode_type
     */
    @ApiModelProperty(notes = "还款方式")
    private Integer loanRepaymentModeType;

    /**
     * 还款频率(月)
     * TODO 当还款方式loanRepaymentModeType为等额本金和等额本息必填
     * 1M	1	repayment_frequency_type
     * 3M	3	repayment_frequency_type
     * 6M   6	repayment_frequency_type
     * 12M	12	repayment_frequency_type
     */
    @ApiModelProperty(notes = "还款频率(月)")
    private Integer repaymentFrequencyType;

    /**
     * 结息频率(月)
     * TODO 当还款方式还款方式为到期还本付息贷款和业务品种ftpBusinessVariety为存款不填此项
     * 1M	    1	interest_frequency_type
     * 3M	    3	interest_frequency_type
     */
    @ApiModelProperty(notes = "结息频率(月)")
    private Integer interestFrequencyType;

    /**
     * 其他调整值
     * TODO 暂不设置
     */
    @ApiModelProperty(notes = "其他调整值")
    private String other;

    public Date getBeginDate() {
        return beginDate;
    }

    public void setBeginDate(Date beginDate) {
        this.beginDate = beginDate;
    }

    public Date getEndDate() {
        return endDate;
    }

    public void setEndDate(Date endDate) {
        this.endDate = endDate;
    }

    public Integer getFtpBusinessVariety() {
        return ftpBusinessVariety;
    }

    public void setFtpBusinessVariety(Integer ftpBusinessVariety) {
        this.ftpBusinessVariety = ftpBusinessVariety;
    }

    public BigDecimal getBusinessAmount() {
        return businessAmount;
    }

    public void setBusinessAmount(BigDecimal businessAmount) {
        this.businessAmount = businessAmount;
    }

    public BigDecimal getCustomerRate() {
        return customerRate;
    }

    public void setCustomerRate(BigDecimal customerRate) {
        this.customerRate = customerRate;
    }

    public Integer getInterestRateType() {
        return interestRateType;
    }

    public void setInterestRateType(Integer interestRateType) {
        this.interestRateType = interestRateType;
    }

    public Integer getRepricingFrequencyType() {
        return repricingFrequencyType;
    }

    public void setRepricingFrequencyType(Integer repricingFrequencyType) {
        this.repricingFrequencyType = repricingFrequencyType;
    }

    public Integer getLoanRepaymentModeType() {
        return loanRepaymentModeType;
    }

    public void setLoanRepaymentModeType(Integer loanRepaymentModeType) {
        this.loanRepaymentModeType = loanRepaymentModeType;
    }

    public Integer getRepaymentFrequencyType() {
        return repaymentFrequencyType;
    }

    public void setRepaymentFrequencyType(Integer repaymentFrequencyType) {
        this.repaymentFrequencyType = repaymentFrequencyType;
    }

    public Integer getInterestFrequencyType() {
        return interestFrequencyType;
    }

    public void setInterestFrequencyType(Integer interestFrequencyType) {
        this.interestFrequencyType = interestFrequencyType;
    }

    public String getOther() {
        return other;
    }

    public void setOther(String other) {
        this.other = other;
    }

    @Override
    public String toString() {
        return "EcardApiFtpInfo{" +
                ", beginDate业务起始日=" + beginDate +
                ", endDate业务到期日=" + endDate +
                ", ftpBusinessVariety业务品种=" + ftpBusinessVariety +
                ", businessAmount业务金额=" + businessAmount +
                ", customerRate对客利率(年利率)=" + customerRate +
                ", interestRateType利率类型=" + interestRateType +
                ", repricingFrequencyType重定价频率(月)=" + repricingFrequencyType +
                ", loanRepaymentModeType还款方式=" + loanRepaymentModeType +
                ", repaymentFrequencyType还款频率(月)=" + repaymentFrequencyType +
                ", interestFrequencyType结息频率(月)=" + interestFrequencyType +
                ", other其他调整值='" + other + '\'' +
                '}';
    }
}
